package com.example.quartz.common.Tool;


import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;


/**
 * @author 打小就爱笑捏
 * @date 2019/11/11
 * me自己的工具类哦~~~
 */
@Component
public final class MyselfUtils {
    private static MyselfUtils myselfUtils = null;
    static {
        /** 类加载时创建，只会创建一个对象 */
        if (myselfUtils == null) myselfUtils = new MyselfUtils();
    }
    private MyselfUtils() {
    }

    /**
     * 根据逗号分隔
     * @param s
     * @return List
     */
    public static List spaceByComma(String s) {
        List returnList = new ArrayList();
        if (ObjectUtils.isNotEmpty(s)) {
            if (s.contains(",")) {
                String[] split = s.split(",");
                for (int i = 0; i < split.length; i++) {
                    returnList.add(split[i]);
                }
            } else {
                returnList.add(s);
            }
        }
        return returnList;
    }


}
